<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:18:23 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>Z+ NATLink - 登录</title>
    <meta name="keywords" content="Z+ NATLink">
    <meta name="description" content="Z+ NATLink是一个集成了先进技术和人性化设计的内网穿透解决方案，旨在为用户提供一个强大、灵活、易于使用的平台来实现内外网之间的无缝连接">

    <link rel="shortcut icon" href="img/favicon.ico"> <link href="css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">

    <div id="app">
        <div class="middle-box text-center loginscreen  animated fadeInDown">
            <div>
                <div>

                    <h1 class="logo-name">Z+</h1>

                </div>
                <h3>欢迎使用 Z+ NATLink</h3>

                <div class="m-t" >
                    <div class="form-group">
                        <input type="text" class="form-control" v-model="loginInfo.username" placeholder="用户名" required="">
                    </div>
                    <div class="form-group">
                        <input type="password" class="form-control" v-model="loginInfo.password" placeholder="密码" required="">
                    </div>
                    <button type="submit" class="btn btn-primary block full-width m-b" @click="login">登 录</button>
                </div>
            </div>
        </div>
    </div>

    <script src="./plugins/vue/vue.js"></script>
    <script src="./plugins/axios/axios.min.js"></script>
    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    loginInfo: {
                        username: '',
                        password: ''
                    }
                }
            },
            methods: {
                login() {
                    if (this.loginInfo.username == null || this.loginInfo.username === '') {
                        alert('请正确填写用户名密码')
                    }
                    axios.post('/api/login', this.loginInfo).then((res) => {
                        if (res.data.code === 200) {
                            window.location.href = '/index.html'
                            window.localStorage.setItem('userInfo', res.data.data)
                        } else {
                            alert("登录失败，请重新尝试")
                        }
                    })

                }
            }
        })

    </script>

</body>


</html>
